package hy;

import org.junit.Test;
import redis.clients.jedis.Jedis;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo1 {
    static Jedis j=new Jedis("192.168.188.100",6379);
    @Test
    public void test1(){
        j.set("address","南京");
        System.out.println(j.get("address"));
        j.incrBy("age",10);
        Set<String> keys= j.keys("*");
        for(String s:keys){
            System.out.println(s+" ,类型："+j.type(s));
        }
        Map<String,String> m=new HashMap<>();
        m.put("u1","a1");
        m.put("u2","a2");
        j.expire("age",5);
        j.hmset("users",m);
        System.out.println(j.hgetAll("users"));
    }
}
